bonus=float(input('输入年终奖金额：'))
tax1=40000*0.03
tax2=(100000-40000)*0.1
tax3=(200000-100000)*0.2
if bonus <= 40000:
    tax=bonus*0.03
elif bonus <= 100000:
    tax=tax1+(bonus-40000)*0.1
elif bonus <=200000:
    tax=tax1+tax2+(bonus-100000)*0.2
else:
    tax=tax1+tax2+tax3+(bonus-200000)*0.5
print('应缴纳税金为：',tax)
